<extend name="Ask/index"/>
<block name="pageAddStatic">
    <script src="__JS__/ask/payment.js"></script>
    <script src="__JSPLUGINS__/Validform_v5.3.2.js"></script>

    <style>
        .Validform_wrong {
            color: red;;
        }
    </style>
</block>
<block name="pageHeader">
    <div class="upper"><a class="fal" href="javascript:history.go(-1)">返回</a>
        <!--<a class="offer payment_time_title" href="javascript:;">悬赏<span class="red">-->
        <!--{:current(C('ASK_SCORE_LIST'))}-->
        <!--</span>积分</a>-->
        <h1>{$title}</h1>
    </div>
</block>
<block name="pageContent">
    <form id="registerform" action="" method="post">
        <div class="payment-box">
        <div class="pagem-con">
            <ul>
                <li class="xuan city">
                    <div class="fsad">
                        <textarea class="into" name="content" placeholder="请输入相关答案" nullmsg="请输入内容！" datatype="s"></textarea>
                    </div>
                    <div></div>
                </li>
                <li class="btn"><a href="javascript:;" onclick="javascript:$('#registerform').submit();">提交问题</a></li>
            </ul>
        </div>
    </div>

    <!-- 弹出层 开始 -->
    <div id="payment_bg"> </div>
    <div class="payment_time_mask book-open">
        <div class="book-box">
            <h4 class="tit1">使用悬赏分数<a class="payment_close" href="javascript:;">x</a></h4>
            <div class="coupon">
                <dl>
                    <volist name="Think.config.ASK_SCORE_LIST" id="vo">
                    <dd>
                        <label>
                            <input class="danxuan" type="radio" name="score" value="{$vo}" <if condition="$key==1">checked</if>>
                            {$vo}分
                        </label>
                    </dd>
                    </volist>
                </dl>
            </div>
            <div class="chaxu payment_close"><a href="javascript:;">确认</a></div>
        </div>
    </div>
    </form>
</block>
<block name="pageJavascript">
    <script>
        var isReturn = false;
        $("#registerform").Validform({
            tiptype:3
            ,showAllError:true
            ,beforeSubmit:function(curform){
                if(!isReturn){
                    var score = $("input[name=score]:checked").val();
                    layer.confirm('您确定要提问吗?',
                    {
                      btn: ['确定','取消'] //按钮
                    }, function(){
                        // $("#registerform").Validform({tiptype:3,showAllError:true)};
                        isReturn = true;
                        $('#registerform').submit();
                    }, function(){
                        isReturn = false;
                    });
                    console.log(isReturn);
                    return false;
                }
                return true;
            }
        });
    </script>
</block>